<template>
  <div class="recommend-wrap">
    <div class="title">周末去哪儿</div>
    <ul>
      <li class="item border-bottom" v-for="item of list" :key="item.id">
        <div class="item-img-wrapper">
          <img class="item-img" :src="item.imgUrl">
        </div>

        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "HomeRecommend",
   props:{
    list:Array
  },
  data() {
    return {
      recommendList: [
        {
          id: "0001",
          imgUrl:
            "http://img1.qunarzz.com/sight/source/1812/9a/0133783cfb5ab4.jpg_r_640x214_62c2dc77.jpg",
          title: "玩转峨眉山",
          desc: "神秘又深厚造就了峨眉山“高出五岳，秀甲九州”"
        },
        {
          id: "0002",
          imgUrl:
            "http://img1.qunarzz.com/sight/source/1505/44/5251f239d3456.jpg_r_640x214_88ab6a42.jpg",
          title: "乐山必游",
          desc: "坐竹排看大佛，还有这么多好玩的地方"
        },
        {
          id: "0003",
          imgUrl:
            "http://img1.qunarzz.com/sight/source/1811/65/7322301be0a92c.jpg_r_640x214_a3485c55.jpg",
          title: "摩崖石刻造像",
          desc:
            "诸事不顺，来抱佛脚，中国最壮观的大佛大盘点~来一场真正的“佛”系之旅，乐山大佛是首选"
        },
        {
          id: "0004",
          imgUrl:
            "http://img1.qunarzz.com/sight/source/1602/ad/9bc84b7c10419.jpg_r_640x214_c96c9063.jpg",
          title: "烂漫花开",
          desc: "成都，花都开好了"
        }
      ]
    };
  }
};
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl';

.recommend-wrap {
  .title {
    background: #eee;
    line-height: 0.8rem;
    text-indent: 0.2rem;
    // margin-top: 0.2rem;
  }

  .item {
    border-bottom: 0.1rem solid #eee;

    .item-img-wrapper {
      overflow: hidden;
      height: 0;
      padding-bottom: 37%;

      // background: red;
      .item-img {
        width: 100%;
      }
    }

    // background: red;
    // overflow: hidden;
    .item-info {
      padding: 0.2rem;
      overflow: hidden;

      .item-title {
        line-height: 0.54rem;
        font-size: 0.32rem;
        ellipsis();
      }

      .item-desc {
        color: #616161;
        line-height: 0.4rem;
        font-size .24rem
        ellipsis();
      }
    }
  }

  .item:last-child {
    border-bottom: none;
  }
}
</style>
